
////cleaning do file for the Michigan Law School Alumni Survey 
/// You must request access to the survey data from https://repository.law.umich.edu/alumni_survey/alumni_survey_dataset.html 
/// save the data in the mlsas survey and then run this do file for cleaning and analysis 


use "dataname.dta", clear 

//sex
gen woman = 1 if v1002==1
replace woman = 0 if v1002==2

//class year
gen class_year=v0003

//Why choose Law: 

sum v1046 v1047 v1048 v1049 v1050 v1051 v1052 v1053 v1054 v1055 v1056 v1057 v1058 

gen choose_prestige = v1046
gen choose_socialrep = v1047
gen choose_improvesoc = v1048
gen choose_security = v1049
gen choose_skill = v1050
gen choose_wealth = v1051
gen choose_challenge = v1052
gen choose_interest = v1053
gen choose_faminfluence = v1054
gen choose_advancement = v1055
gen choose_lifebalance = v1056
gen choose_other = v1057
gen choose_text = v1058



***Personal Background: 
gen age= v1006
replace age = . if age>68
replace age = . if age<15 //i'm dropping the few cases that say less than 15. There is one 15, 16, 17 *2), 18 (6)...


gen married= v1043
gen wk_pt_child = v3102 //if working part time due to child care
gen nowk_childcare = v3107
gen married_beforeLS= 1 if v6012==1 //never married 
replace married_beforeLS=0 if v6012>1 
gen married_gratuation= 1 if v6013==1 //never married 
replace married_gratuation=0 if v6013>1

gen married_now= 1 if v6014==1 //never married 
replace married_now=0 if v6014>1

gen divorced_now= 1 if v6014==3 //divorced now 
replace divorced_now=0 if v6014!=3 & v6014!=.
//Partner Status

gen partner_lawyer= 1 if  v6021==1
replace partner_lawyer = 0 if v6021!=1 & v6021!=.

gen partner_homemaker= 1 if  v6021==4
replace partner_homemaker = 0 if v6021!=4 & v6021!=.  //26% of men have a homeaker and 1% of women 

gen partner_supportscareer= v6023
gen nkids_beforeLS= v6024
gen nkids_gratuation= v6025
gen nkids_now= v6026
gen nkids_sincels= v6027

gen childcare_demand = v6028

gen nkids_livewith = v6029
gen kid_age_youngest = v6030

gen kids_inhouse = 1 if nkids_livewith>=1
replace kids_inhouse=0 if  nkids_livewith==0



egen choice_agentic_goals = rowmean(choose_prestige choose_wealth choose_advancement choose_challenge)
egen choice_communal_goals = rowmean(choose_socialrep choose_improvesoc choose_lifebalance)




gen man = 1 if woman ==0
replace man = 0 if woman==1		
global controls man age  married kids_inhouse

label var choice_agentic_goals "Importance of Agentic Goals for Choosing Law School"
label var woman "Woman"
label var age "Age"
label var married "Married"
label var kids_inhouse "Children  in House"


 eststo clear 	
eststo choice_agentic: reg choice_agentic_goals $controls v0003
 #delimit;
esttab using mainresults_goals.rtf, se b(%9.3f) starlevels( * .10 ** .05 *** .01) r2(%9.2f) 
 title ("Table 1: ADD TO OTHER TABLE")
 addnote("Controls include age, married, any children in home, year of graduation")
 nogap
 label
 compress replace;
 #delimit cr	
 